Component({
   data: {
     sclect: 0,
     list: [
      {
          iconPath: "/images/index.png",
          pagePath: "/pages/index/index",
          selectedIconPath: "/images/index.png",
          text: "首页",
          type: 0
      },
      {
        iconPath: "/images/classify.png",
        pagePath: "/pages/classify/classify",
        selectedIconPath: "/images/classify.png",
        text: "分类",
        type: 0
    },
    {
        type: 1,
        pagePath: "/pages/publish/publish",
    },
    {
      iconPath: "/images/collection.png",
      pagePath: "/pages/collection/collection",
      selectedIconPath: "/images/collection.png",
      text: "收藏夹",
      type: 0
  },
  {
    iconPath: "/images/me.png",
    pagePath: "/pages/me/me",
    selectedIconPath: "/images/me.png",
    text: "我的",
    type: 0,
  }
    ]
   },

   methods:{
      selectPage(e){
        const { index, page, type } = e.currentTarget.dataset;
        if (index !== this.data.select && type === 0){
          wx.switchTab({
            url: page,
          })
        } else {
           wx.navigateTo({
             url: page,
           })
        }
      }
   }
})
